﻿using System;

namespace WpfDownload
{
	/// <summary>
	/// Holds all the information about a stream subjected to download
	/// </summary>
	public class DownloadRecord
	{
		public DownloadRecord(Uri uri)
		{
			Uri = uri;
			Status = "Initialized";
		}

		private Uri uri;

		/// <summary>
		/// The Uri of the file 
		/// </summary>
		public Uri Uri
		{
			get { return uri; }
			set
			{
				uri = value;
				string[] parts = uri.AbsolutePath.Split('/');
				FileName = parts[parts.Length - 1];
			}
		}

		/// <summary>
		/// Use to prefix the files locally
		/// </summary>
		public string Prefix { get; set; }

		/// <summary>
		/// The filename, initialized if can be found from the uri
		/// </summary>
		public string FileName { get; set; }

		/// <summary>
		/// Where the dowload action goes to
		/// </summary>
		public string DestinationFolder { get; set; }

		/// <summary>
		/// The actual record status
		/// </summary>
		public string Status { get; set; }
	}
}
